package com.bao.work;

public class Interface01 {
    public static void main(String[] args) {
        Star s1=new Star();
        s1.shine();

        Universe u=new Sun();
        u.doAnything();

        Sun sun=(Sun) u;
        sun.shine();
    }
}
interface Universe{
    void doAnything();
}
class Star {
    public void shine(){
        System.out.println("星星一闪一闪亮晶晶");
    }
}
class Sun extends Star implements Universe{
    @Override
    public void doAnything() {
        System.out.println("sun:太阳吸引九大行星旋转");
    }

    @Override
    public void shine() {
        System.out.println("光照八分钟,到达地球");
    }
}
